/* start module: code */
$pyjs.loaded_modules['code'] = function (__mod_name__) {
	if($pyjs.loaded_modules['code'].__was_initialized__) return $pyjs.loaded_modules['code'];
	var $m = $pyjs.loaded_modules["code"];
	$m.__repr__ = function() { return "<module: code>"; };
	$m.__was_initialized__ = true;
	if ((__mod_name__ === null) || (typeof __mod_name__ == 'undefined')) __mod_name__ = 'code';
	$m.__name__ = __mod_name__;


	$m['db'] = $p['___import___']('google.appengine.ext.db', null, null, false);
	$m['webapp'] = $p['___import___']('google.appengine.ext.webapp', null, null, false);
	$m['run_wsgi_app'] = $p['___import___']('google.appengine.ext.webapp.util.run_wsgi_app', null, null, false);
	$m['JsonHandler'] = $p['___import___']('JsonHandlerGAE.JsonHandler', null, null, false);
	$m['Note'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition.__module__ = 'code';
		$cls_definition['content'] = $pyjs_kwargs_call($m['db'], 'StringProperty', null, null, [{multiline:true}]);
		$cls_definition['date'] = $pyjs_kwargs_call($m['db'], 'DateTimeProperty', null, null, [{auto_now_add:true}]);
		var $bases = new Array($p['getattr']($m['db'], 'Model'));
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data.__setitem__($item, $cls_definition[$item]); }
		return $p['_create_class']('Note', $p['tuple']($bases), $data);
	})();
	$m['MyJsonHandler'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition.__module__ = 'code';
		$method = $pyjs__bind_method2('get_notes', function() {
			if (this.__is_instance__ === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var notes;
			notes = $m['db']['GqlQuery']('SELECT * FROM Note ORDER BY date DESC LIMIT 10');
			notes = function(){
				var $iter1_nextval,$iter1_type,$collcomp1,$iter1_iter,note,$iter1_idx,$iter1_array;
	$collcomp1 = $p['list']();
			$iter1_iter = notes;
			$iter1_nextval=$p['__iter_prepare']($iter1_iter,false);
			while (typeof($p['__wrapped_next']($iter1_nextval).$nextval) != 'undefined') {
				note = $iter1_nextval.$nextval;
				$collcomp1['append']($p['dict']([['content', $p['getattr'](note, 'content')], ['date', $p['str']($p['getattr'](note, 'date'))]]));
			}

	return $collcomp1;}();
			return notes;
		}
	, 1, [null,null,['self']]);
		$cls_definition['get_notes'] = $method;
		$method = $pyjs__bind_method2('post_note', function(content) {
			if (this.__is_instance__ === true) {
				var self = this;
			} else {
				var self = arguments[0];
				content = arguments[1];
			}
			var note;
			note = $m['Note']();
			note.content = content;
			note['put']();
			return self['get_notes']();
		}
	, 1, [null,null,['self'],['content']]);
		$cls_definition['post_note'] = $method;
		$method = $pyjs__bind_method2('get_source', function() {
			if (this.__is_instance__ === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var $add14,$add12,$add15,$add13,$add2,$add3,$add16,$add1,$add6,$add7,$add4,$add5,$add10,$add8,$add9,$add18,$add17,$add11;
			return $p['list']([$p['__op_add']($add17=$p['__op_add']($add15=$p['__op_add']($add13=$p['__op_add']($add11=$p['__op_add']($add9=$p['__op_add']($add7=$p['__op_add']($add5=$p['__op_add']($add3=$p['__op_add']($add1='## code.py\n\n',$add2=$m.file('code.py')['read']()),$add4='\n\n## JsonHandlerGAE.py\n\n'),$add6=$m.file('JsonHandlerGAE.py')['read']()),$add8='\n\n## app.yaml\n\n'),$add10=$m.file('app.yaml')['read']()),$add12='\n\n## client.py\n\n'),$add14=$m.file('client.py')['read']()),$add16='\n\n## BackendProxy.py\n\n'),$add18=$m.file('BackendProxy.py')['read']())]);
		}
	, 1, [null,null,['self']]);
		$cls_definition['get_source'] = $method;
		var $bases = new Array($m['JsonHandler']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data.__setitem__($item, $cls_definition[$item]); }
		return $p['_create_class']('MyJsonHandler', $p['tuple']($bases), $data);
	})();
	$m['application'] = $pyjs_kwargs_call($m['webapp'], 'WSGIApplication', null, null, [{debug:true}, $p['list']([$p['tuple'](['/json', $m['MyJsonHandler']])])]);
	$m['main'] = function() {

		$m['run_wsgi_app']($m['application']);
		return null;
	};
	$m['main'].__name__ = 'main';

	$m['main'].__bind_type__ = 0;
	$m['main'].__args__ = [null,null];
	if ($p['bool']($p['op_eq']((typeof __name__ == "undefined"?$m.__name__:__name__), '__main__'))) {
		$m['main']();
	}
	return this;
}; /* end code */


/* end module: code */


/*
PYJS_DEPS: ['google.appengine.ext.db', 'google', 'google.appengine', 'google.appengine.ext', 'google.appengine.ext.webapp', 'google.appengine.ext.webapp.util.run_wsgi_app', 'google.appengine.ext.webapp.util', 'JsonHandlerGAE.JsonHandler', 'JsonHandlerGAE']
*/
